package com.heima.controller;

import com.heima.utils.AliOSSUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@Api(tags = "通用接口")
public class CommonController {
    @Autowired
    private AliOSSUtils aliOSSUtils;

    @PostMapping("/vm-service/sku/fileUpload")
    @ApiOperation("文件上传")
    public String fileUpload(MultipartFile fileName) throws IOException {
        return aliOSSUtils.upload(fileName);
    }
}
